<?php
	require_once(realpath(dirname(__FILE__)) . "/../../classes/Dossier.class.php");
	require_once(realpath(dirname(__FILE__)) . "/../../classes/Dossierdesc.class.php");
	
	/* Substitutions de type dossier */
		
	function substitdossier($texte){
		global $id_dossier;
		
		$tdossier = new Dossier();
		$tdossierdesc = new Dossierdesc();
		
		if($id_dossier){
			$tdossier->charger($id_dossier);
			$tdossierdesc->charger($tdossier->id, $_SESSION['navig']->lang);
		}

		$texte = str_replace("#DOSSIER_CHAPO", "$tdossierdesc->chapo", $texte);
		$texte = str_replace("#DOSSIER_DESCRIPTION", "$tdossierdesc->description", $texte);
		$texte = str_replace("#DOSSIER_POSTSCRIPTUM", "$tdossierdesc->postscriptum", $texte);
		$texte = str_replace("#DOSSIER_ID", "$tdossier->id", $texte);
		$texte = str_replace("#DOSSIER_NOM", "$tdossierdesc->titre", $texte);
		$texte = str_replace("#DOSSIER_PARENT", "$tdossier->parent", $texte);

		return $texte;
	}
	
?>